package com.ruoyi.ams.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 物联网资产设备用户权限信息对象 ams_own_user_asset_authority
 * 
 * @author yfkj
 * @date 2021-10-15
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AmsOwnUserAssetAuthority extends BaseEntity
{
    private static final long serialVersionUID = 1L;
    /** 物联网资产设备用户授权信息主键 */
    @TableField(exist = true)
    @ApiModelProperty(value =  "${comment}")
    @TableId(type= IdType.AUTO)
    private Long ownUserAssetAuthorityId;
    /** 资产设备 */
    @Excel(name = "资产设备")
    @TableField(exist = true)
    @ApiModelProperty(value =  "资产设备")
    private Long assetId;
    /** 人员 */
    @Excel(name = "人员")
    @TableField(exist = true)
    @ApiModelProperty(value =  "人员")
    private Long userId;
    /** 授权者id */
    @Excel(name = "授权者id")
    @TableField(exist = true)
    @ApiModelProperty(value =  "授权者id")
    private Long grantUserId;
    /** 授权截止日期 */
    @Excel(name = "授权截止日期")
    @TableField(exist = true)
    @ApiModelProperty(value =  "授权截止日期")
    private Long endTime;
    /** 授权开始时间 */
    @Excel(name = "授权开始时间")
    @TableField(exist = true)
    @ApiModelProperty(value =  "授权开始时间")
    private Long startTime;

    /** 状态：（0用户申请中，1管理员同意，-1管理员拒绝,2管理员直接授权） */
    @Excel(name = "状态：", readConverterExp = "0=用户申请中，1管理员同意，-1管理员拒绝,2管理员直接授权")
    @TableField(exist = true)
    @ApiModelProperty(value =  "状态：")
    private Integer status;

    /**  授权类型  1用户申请授权类型，2管理员直接同意授权类型）*/
    private Integer grantType;

    /** 资产使用部门 */
    private Long deptId;

    public static final String OWN_USER_ASSET_AUTHORITY_ID="own_user_asset_authority_id";
    public static final String ASSET_ID="asset_id";
    public static final String USER_ID="user_id";
    public static final String GRANT_USER_ID="grant_user_id";
    public static final String END_TIME="end_time";
    public static final String START_TIME="start_time";
    public static final String STATUS="status";
    public static final String CREATE_BY="create_by";
    public static final String CREATE_TIME="create_time";
    public static final String UPDATE_BY="update_by";
    public static final String UPDATE_TIME="update_time";
    public static final String REMARK="remark";
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("ownUserAssetAuthorityId", getOwnUserAssetAuthorityId())
            .append("assetId", getAssetId())
            .append("userId", getUserId())
            .append("grantUserId", getGrantUserId())
            .append("endTime", getEndTime())
            .append("startTime", getStartTime())
            .append("status", getStatus())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .toString();
    }
}
